﻿using Rbac.Domain;
using Rbac.Services.Admins.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rbac.Services.Admins
{
    public interface IAdminService
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultDto Create(CreateDto dto);

        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultDto Register(RegisterDto dto);

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultLoginDto Login(LoginDto dto);

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        (List<AdminDto>, int) Page(AdminQueryDto queryDto, int PageIndex = 1, int PageSize = 10);

        /// <summary>
        /// 检查用户名是否可用
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        bool CheckUserName(string UserName, int AdminId = 0);

        /// <summary>
        /// 根据ID查询
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        AdminDto Query(int Id);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultDto Update(EditDto dto);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        ResultDto Delete(int Id);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        ResultDto ManyDelete(List<AdminDto> list);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        ResultDto ManyDelete(List<int> list);
    }
}
